clear
rm sess.csh
apl sess.csh login
: mainmenu
clear
echo
echo
echo
echo "				Session Generation"
echo "				------------------"
echo
echo "				    Main Menu"
echo "				    ---------"
echo
echo "		1)	Log off"
echo "		2)	Visit a SIG"
echo "		3)	Abort creation of file"
echo
echo
echo
echo
echo -n "Your choice:"
read choice
if same $choice 1 logoff
if same $choice 2 sigmenu
if same $choice 3 abort
echo
echo -n "That was an illegal choice.  Press return, please: "
read choice
goto mainmenu
: logoff
apl sess.csh logoff
goto end
: sigmenu
echo -n "Please enter the page number of the SIG:"
read choice
apl sess.csh "gosig " $choice
: sig2menu
clear
echo
echo
echo
echo "				SIG Menu"
echo "				--------"
echo
echo "		1)	Read all new messages"
echo "		2)	Read your messages, qsn, and set high message counter~"
echo "		3)	Post a new message"
echo "		4)	Post a reply"
echo "		5)	Set section"
echo "		6)	Read Indivdual"
echo "		m)	Return to main menu"
echo
echo
echo
echo
echo -n "Your choice:"
read choice
if same $choice 1 sigrn
if same $choice 2 sigrm
if same $choice 3 sigl
if same $choice 4 sigre
if same $choice 5 sigss
if same $choice 6 sigri
if same $choice m mainmenu
if same $choice M mainmenu
echo
echo -n "Invalid choice.  Please enter a return:"
read choice
goto sig2menu

: sigrn
apl sess.csh rn
goto sigwrite

: sigrm
apl sess.csh rmqsnrr

: sigwrite
echo -n "Write results to what file:"
read choice
apl sess.csh "write " $choice
goto sig2menu


: sigl
echo -n "Please enter the file name containing the message:"
read fname
if !fexist $fname sigerfile
echo -n "Please enter to whom the message is for:"
read to
echo -n "Please enter the subject:"
read subject
echo -n "Please enter the section (precede with 'P' for private):"
read section
apl sess.csh "leave " $fname " " $subject " " $to " " $section
goto sig2menu


: sigre
echo -n "Please enter the file name containing the message:"
read fname
if !fexist $fname sigerfile
echo -n "Please enter to whom the message is for:"
read to
echo -n "Please enter the message to reply to:"
read subject
echo -n "Please enter the section (precede with 'P' for private):"
read section
apl sess.csh "reply " $fname " " $subject " " $to " " $section
goto sig2menu


: sigss
echo -n "SS to which section:"
read choice
apl sess.csh "ss " $choice
goto sig2menu


: sigri
echo -n "RI which message:"
read choice
apl sess.csh "ri " $choice
goto sigwrite



: sigerfile
echo "But there is no such file!"
echo -n "Press return:"
read choice
goto sig2menu
: abort
rm sess.csh
: end
clear
echo "		End of session generation."
